Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Enabling --non-masquerade-cidr option #1361

Merged
merged 8 commits into from
Oct 9, 2017
Merged

Enabling --non-masquerade-cidr option #1361

merged 8 commits into from
Oct 9, 2017

Conversation

dbourasseau
Copy link
Contributor

@dbourasseau dbourasseau commented Aug 28, 2017

What this PR does / why we need it:

This PR enables configuration of the --non-masquerade-cidr option at the kubelet level.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #1360

Special notes for your reviewer:

Release note:


This change is Reviewable

@@ -50,6 +50,7 @@ ExecStart=/usr/bin/docker run \
--network-plugin=${KUBELET_NETWORK_PLUGIN} \
--max-pods=${KUBELET_MAX_PODS} \
--node-status-update-frequency=${KUBELET_NODE_STATUS_UPDATE_FREQUENCY} \
--non-masquerade-cidr=${KUBELET_NON_MASQUERADE_CIDR} \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this as a valid option on the documentation. Can you confirm? -- https://kubernetes.io/docs/admin/kubelet/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page at least mentions it: https://kubernetes.io/docs/concepts/cluster-administration/network-plugins/

Pretty sure I saw it somewhere on the kubelet options previously.

@@ -115,6 +115,7 @@ write_files:
KUBE_CTRL_MGR_POD_EVICTION_TIMEOUT={{WrapAsVariable "kubernetesCtrlMgrPodEvictionTimeout"}}
KUBE_CTRL_MGR_ROUTE_RECONCILIATION_PERIOD={{WrapAsVariable "kubernetesCtrlMgrRouteReconciliationPeriod"}}
{{if IsKubernetesVersionGe "1.6.0"}}
KUBELET_NON_MASQUERADE_CIDR={{WrapAsVariable "kubernetesNonMasqueradeCIDR"}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on what the option can take. Should this be an array of CIDR blocks?

@dbourasseau
Copy link
Contributor Author

Any news ? Have you watched the pull request? must we do something else?

@mrosterm
Copy link

Whats the status on this one?

@dbourasseau
Copy link
Contributor Author

We are still waiting for your response

@Azure Azure deleted a comment from msftclas Sep 26, 2017
@Azure Azure deleted a comment from msftclas Sep 26, 2017
@SaaldjorMike
Copy link
Contributor

Linking this with issue #425

@SaaldjorMike
Copy link
Contributor

SaaldjorMike commented Sep 27, 2017

@jackfrancis
Copy link
Member

Closing this as --non-masquerade-cidr is deprecated. Happy to iterate on a more current solution if you'd like to file an issue that describes the high order intention.

@jackfrancis jackfrancis closed this Oct 3, 2017
@bathizte
Copy link

bathizte commented Oct 4, 2017

Hello @jackfrancis

The high order intention is hopefully explained in #1360 linked issue.

We understand the option has been deprecated a month ago in master and will be removed in a future version but :

  • K8s deployments using pre-1.8 version still need some parts of this PR if deploying on a private subnet (unless we have missed something).
  • We may want to check that along with deprecating the option, a fix or an other mechanism has been commted to deploy a k8s cluster in a private network and disable masquerading on the pod cidr.
    In the case a new option allows this, let's update the PR specifying the new option for Acs engine k8s v>=1.8 deployments.

@jackfrancis
Copy link
Member

@bathizte We did some further investigation, and this is still the only way (as far as we know) to do this in v1.8, so we'll proceed. Thanks!

@jackfrancis jackfrancis reopened this Oct 4, 2017
@ghost ghost assigned jackfrancis Oct 4, 2017
@ghost ghost added the in progress label Oct 4, 2017
dbourasseau added 4 commits October 4, 2017 14:24
… in a network that has already used the 10.0.0.0/8, and therefore activated NAT of a pod to an address in 10.0.0.0/8
jackfrancis
jackfrancis previously approved these changes Oct 4, 2017
Copy link
Member

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sylr
Copy link
Contributor

sylr commented Oct 5, 2017

I had a similar PR for this (#1142) but I closed it because if I think I saw that the --non-masquerade-cidr option of kubelet is deprecated.

@lachie83
Copy link
Member

lachie83 commented Oct 6, 2017

@jackfrancis when can we get this merged?

@jackfrancis
Copy link
Member

Been having trouble getting it to pass Windows e2e, will re-poke.

Copy link
Member

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jackfrancis jackfrancis merged commit 8281069 into Azure:master Oct 9, 2017
@ghost ghost removed the in progress label Oct 9, 2017
@karataliu
Copy link
Contributor

We'd better begin seeking for new solutions, as @sylr mentioned this flag is deprecated:

https://github.com/kubernetes/kubernetes/blob/v1.8.0/cmd/kubelet/app/options/options.go#L340

@tanner-bruce
Copy link

tanner-bruce commented Dec 11, 2017

@jackfrancis @karataliu I just came across the ip-masq-agent today

EDIT
Confirmed: I tested ip-masq-agent on my ACS-Engine provisioned cluster.

I've edited my vnet to be 10.240.0.0/16. My Pod CIDR is 10.244.0.0/16. My third-party vnet is 10.128.0.0/16. With the default config, I was unable to talk to 10.128/16.

With this configmap, and the basic ip-masq-agent provided by the authors, everything works nicely:

apiVersion: v1
data:
  config: |
    nonMasqueradeCIDRs:
    - 10.244.0.0/16
    masqLinkLocal: false
    resyncInterval: 10s
kind: ConfigMap
metadata:
  creationTimestamp: null
  name: ip-masq-config
  namespace: kube-system
  selfLink: /api/v1/namespaces/kube-system/configmaps/ip-masq-config

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

k8s integration with existing private network